<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>Document</title>
</head>
<body>

</body>
<script type="text/javascript">

    var obj = {
        "name":"张三",
        "age" : 18 ,
        "sex" : "男" ,
        "height": 185 ,
        "gongzi": 5000
    };


    console.log(obj);
    console.log(obj.name);   //张三
    console.log(obj["name"]); //张三
    var a = "age";
    console.log(obj[a]);  //18
    console.log(obj.gongzi);   //5000

</script>
</html>